using JGSY.CMS.LowCode.Platform.Application.DTOs;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JGSY.CMS.LowCode.Platform.Application.Interfaces
{
    /// <summary>
    /// 安全服务接口。
    /// 提供安全指标统计、威胁检测、设备管理、登录历史等安全相关底层服务功能接口定义。
    /// </summary>
    public interface ISecurityService
    {
        /// <summary>
        /// 获取安全指标统计
        /// </summary>
        /// <returns>安全指标数据</returns>
        Task<SecurityMetricsDto> GetMetricsAsync();
        
        /// <summary>
        /// 获取威胁列表
        /// </summary>
        /// <param name="severity">威胁严重程度</param>
        /// <param name="page">页码</param>
        /// <param name="limit">每页数量</param>
        /// <returns>威胁列表</returns>
        Task<IEnumerable<ThreatDto>> GetThreatsAsync(string severity, int page = 1, int limit = 10);
        
        /// <summary>
        /// 获取地理位置登录记录
        /// </summary>
        /// <param name="days">查询天数</param>
        /// <returns>地理位置登录记录列表</returns>
        Task<IEnumerable<GeographicLoginDto>> GetGeographicLoginsAsync(int days = 7);
        
        /// <summary>
        /// 获取设备列表
        /// </summary>
        /// <returns>设备列表</returns>
        Task<IEnumerable<DeviceDto>> GetDevicesAsync();
        
        /// <summary>
        /// 信任设备
        /// </summary>
        /// <param name="deviceId">设备标识符</param>
        /// <returns>信任设备任务</returns>
        Task TrustDeviceAsync(long deviceId);
        
        /// <summary>
        /// 移除设备
        /// </summary>
        /// <param name="deviceId">设备标识符</param>
        /// <returns>移除设备任务</returns>
        Task RemoveDeviceAsync(long deviceId);
        
        /// <summary>
        /// 获取登录历史
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="limit">每页数量</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>登录历史记录列表</returns>
        Task<IEnumerable<LoginHistoryDto>> GetLoginHistoryAsync(int page = 1, int limit = 10, string? startDate = null, string? endDate = null);
    }
} 
